/*
 *  WaveFunctionXSineX.h
 *  SoundController0002
 *
 *  Created by jiro on 10/11/11.
 *  Copyright 2010 jiro music. All rights reserved.
 *
 */

#pragma once

#include "WaveFunction.h"
#include <cmath>
#include <iostream>

namespace sc {

	class WaveFunctionFactory;

	/*
		y = k * ( ( a * x - b ) ^ ( powerOfX ) * sin( 2 * pi * F * ( a * x - b ) ) )
		x = [ 0, next 0 of y )
　	*/
	class WaveFunctionXSinX : public WaveFunction
	{
	
	friend class WaveFunctionFactory;

	private:

		double powerOfX;

	public:

		double operator() ( double x ) const;

		virtual bool operator == ( const WaveFunction& rhs ) const;

		virtual bool operator != ( const WaveFunction& rhs ) const;

		virtual bool operator < ( const WaveFunction& rhs ) const;

		double GetPowerOfX() const;
		
	private:

		WaveFunctionXSinX( double powerOfX, double cycle, bool isReverse = false, bool isNormalize = true );

		WaveFunctionXSinX( double powerOfX, double cycle, Range range, bool isReverse = false, bool isNormalize = true );		

	};
}
